package br.pucrio.inf.aaaong.models.form.validation.defaults;

import java.util.ArrayList;
import java.util.List;

import br.pucrio.inf.aaaong.models.form.errors.FormError;
import br.pucrio.inf.aaaong.models.form.validation.FormValidation;

public class NotNullFormValidation implements FormValidation {
	
	@Override
	public List<FormError> getErrors(Object value, String fieldName) {
		List<FormError> errors = new ArrayList<FormError>();
		System.out.println(value);
		if (value == null) {
			FormError error = new FormError("é obrigatório.", fieldName);
			errors.add(error);
		}
		
		return errors;
	}
}
